﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="QueryTrainingCourse.ascx.vb"
    Inherits="WebForm_ManageTrainingCourse_QueryTrainingCourse" %>
<table align="center">
    <tr>
        <td align="right">
            <asp:Label ID="Label1" runat="server" Text="<%$ Resources:CourseType %>"></asp:Label>
        </td>
        <td>
            <asp:DropDownList ID="ddlGroupType" runat="server" DataSourceID="SqlDataSource1"
                DataTextField="Text" DataValueField="Value">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                SelectCommand="SELECT [Value], [Text] FROM [CodeMapping] WHERE (([TableName] = @TableName) AND ([Value] &lt;&gt; @Value) AND ([ColumnName] = @ColumnName))">
                <SelectParameters>
                    <asp:Parameter DefaultValue="TrainingCourseGroup" Name="TableName" Type="String" />
                    <asp:Parameter DefaultValue="W" Name="Value" Type="String" />
                    <asp:Parameter DefaultValue="GroupType" Name="ColumnName" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
        </td>
        <td align="right">
            <asp:Button ID="btnQuery" runat="server" Text="<%$ Resources:Query %>" />
        </td>
    </tr>
</table>
<My:MyGridView ID="GV" SkinID="pager" runat="server" DataKeyNames="Id" AllowHoverSelect="False"
    MySortDirection="Ascending" AutoGenerateColumns="False" EmptyDataText="<%$ Resources:EmptyData %>"
    AllowHoverEffect="False" AllowPaging="True" AllowSorting="True" MouseOverColor=""
    TotalRowCount="0">
    <Columns>
        <asp:BoundField DataField="CourseTypeText" HeaderText="<%$ Resources:CourseType %>"
            SortExpression="CourseTypeText">
            <headerstyle wrap="False" />
            <itemstyle wrap="False" />
        </asp:BoundField>
        <asp:BoundField DataField="CourseName" HeaderText="<%$ Resources:CourseName %>" SortExpression="CourseName" />
        <asp:BoundField DataField="TeacherName" HeaderText="<%$ Resources:TeacherName %>"
            SortExpression="TeacherName">
            <headerstyle wrap="False" />
            <itemstyle wrap="False" />
        </asp:BoundField>
        <asp:BoundField DataField="TeacherTEL" HeaderText="<%$ Resources:TeacherTEL %>" SortExpression="TeacherTEL">            
            <headerstyle wrap="False" />
            <itemstyle wrap="False" />
        </asp:BoundField>
        <asp:BoundField DataField="TeacherEmail" HeaderText="<%$ Resources:TeacherEmail %>" SortExpression="TeacherEmail" />
        <asp:BoundField DataField="Org" HeaderText="<%$ Resources:Org %>" SortExpression="Org">
            <headerstyle wrap="False" />
            <itemstyle wrap="False" />
        </asp:BoundField>
        <asp:BoundField DataField="Hour" HeaderText="<%$ Resources:Hour %>" SortExpression="Hour">
            <headerstyle wrap="False" />
            <itemstyle wrap="False" />
        </asp:BoundField>
        <asp:TemplateField>
            <itemtemplate>
                <asp:LinkButton ID="lbtnEdit" runat="server" Text="<%$ Resources:Edit %>" 
                    CommandName="Select"></asp:LinkButton>
            </itemtemplate>
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False">
            <itemtemplate>
                <asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                    OnClientClick="<%$ Resources:DeleteConfirm %>" 
                    Text="<%$ Resources:Delete %>" onclick="lbtnDelete_Click"></asp:LinkButton>
            </itemtemplate>
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>
    </Columns>
</My:MyGridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="BLL_Select" TypeName="BLL_QueryTrainingCourse" DeleteMethod="BLL_Delete">
    <DeleteParameters>
        <asp:Parameter Name="original_Id" Type="Int32" />
    </DeleteParameters>
    <SelectParameters>
        <asp:Parameter Name="GroupType" Type="String" ConvertEmptyStringToNull="false" />
    </SelectParameters>
</asp:ObjectDataSource>
